import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login.vue'
// 引入首页组件
import Index from '../components/index.vue'
// 引入用户列表
import Users from '../components/userAdmin/userList.vue'
// 引入权限列表
import Rights from '../components/authorityAdmin/authorityList.vue'
// 引入角色列表
import Roles from '../components/authorityAdmin/roleList.vue'
// 引入商品
import Goods from '../components/shopAdmin/shopList.vue'
import Params from '../components/shopAdmin/classifyList.vue'
import Categories from '../components/shopAdmin/shopCalssify.vue'
import Goodsadd from '../components/shopAdmin/goods-add.vue'
// 引入 订单列表
import Orders from '../components/orderAdmin/orderList.vue'
// 引入 数据报表
import Reports from '../components/dataStatistics/dataReport.vue'
// 引入 mouth
import Mouth from '../components/mouth.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/login',
    // name: 'home',
    component: Login
  },
  {
    path: '/index',
    name: 'index',
    component: Index,
    children: [
      { path: '', component: Mouth },
      { path: '/users', component: Users },
      { path: '/roles', component: Roles },
      { path: '/rights', component: Rights },
      { path: '/goods', component: Goods },
      { path: '/params', component: Params },
      { path: '/categories', component: Categories },
      { path: '/orders', component: Orders },
      { path: '/reports', component: Reports },
      { path: '/goods-add', component: Goodsadd }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
